#pragma once


/*
 *	base class for Opengl-enabed MFC views
 *	in the derived class you have to re-define:
 *	- RenderScene()	-- there you put all your drawing
 *	- OnCreate() -- to make any initializations
 *	- OnDestroy() -- all cleanup goes there
 *	- OnSize() -- if you want different resize behavior
 */




// COpenGLView view

class COpenGLView : public CView
{
	DECLARE_DYNCREATE(COpenGLView)

protected:
	COpenGLView();           // protected constructor used by dynamic creation
	virtual ~COpenGLView();

public:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	DECLARE_MESSAGE_MAP()


	/*
	 *	OpenGL protected members here
	 */
	HGLRC m_hRC;	//Rendering Context
	CDC* m_pDC;		//Device Context
	
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnDestroy();
	
	
	
	

	/*
	 *	OpenGL mandatory functions
	 */
	BOOL InitializeOpenGL();
	BOOL SetupPixelFormat();
	virtual void RenderScene();
	void SetClearColor(COLORREF color, float alpha=1.0f);
	void SetClearColor(float r,float g,float b,float alpha=1.0f);
	void SetClearColor(float color[4]);

protected:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
public:
//	afx_msg void OnNavigationFollownextshark();
};


